<template>
  <div class="common-layout">
    <div class="container">
      <!-- 顶部应用栏 -->
      <Header/>

      <div class="main-content">
        <!-- 侧边导航栏 -->
        <Aside/>

        <!-- 主内容区域 -->
        <Content/>
      </div>

      <!-- 底部 -->
      <Footer/>
    </div>
  </div>
</template>

<script>
import Aside from "./layout/Aside";
import Header from "@/layout/Header";
import Content from "@/layout/Content";
import Footer from "@/layout/Footer";
export default {
  name: 'App',
  setup(){
  },
  components:{Aside,Content,Header,Footer}

}
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/*body {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  min-height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}*/

.container {
  width: 100vw;
  max-width: 100vw;
  background: white;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.app-bar {
  background: white;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.toggle-btn {
  margin-right: 20px;
  cursor: pointer;
  color: #5a5a5a;
  transition: all 0.3s;
}

.toggle-btn:hover {
  color: #409eff;
  transform: scale(1.1);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  flex-grow: 1;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(45deg, #409eff, #79bbff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.user-name {
  font-weight: 500;
}


.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  background: linear-gradient(to bottom, #304156, #1f2d3d);
  width: 240px;
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #bfcbd9;
}

.sidebar.collapsed {
  width: 64px;
}

.logo-area {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
  color: #409eff;
}

.logo-text {
  font-size: 18px;
  font-weight: bold;
  color: white;
  white-space: nowrap;
}

.sidebar.collapsed .logo-text {
  display: none;
}

.nav-menu {
  flex: 1;
  padding: 10px 0;
  border-right: none;
}

.el-menu {
  border-right: none !important;
  background-color: transparent !important;
}

.el-menu-item {
  height: 50px !important;
  line-height: 50px !important;
  margin: 4px 0;
  border-radius: 0 8px 8px 0;
  transition: all 0.3s !important;
  color: #bfcbd9 !important;
}

.el-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.el-menu-item.is-active {
  background: linear-gradient(to right, #409eff, rgba(64, 158, 255, 0.3)) !important;
  color: white !important;
  font-weight: 500;
}

.el-sub-menu__title {
  height: 50px !important;
  line-height: 50px !important;
  color: #bfcbd9 !important;
  margin: 4px 0;
}

.el-sub-menu__title:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.content-area {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  background-color: #f5f7fa;
}

.dashboard-title {
  margin-bottom: 25px;
  color: #1f2d3d;
  font-size: 1.8rem;
  font-weight: 600;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 24px;
}

.card-icon.users {
  background: linear-gradient(45deg, #409eff, #79bbff);
  color: white;
}

.card-icon.orders {
  background: linear-gradient(45deg, #67c23a, #95d475);
  color: white;
}

.card-icon.revenue {
  background: linear-gradient(45deg, #e6a23c, #f0c78a);
  color: white;
}

.card-icon.activity {
  background: linear-gradient(45deg, #f56c6c, #f89898);
  color: white;
}

.card-title {
  font-size: 1rem;
  color: #909399;
  font-weight: 500;
}

.card-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #303133;
}

.card-footer {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #67c23a;
  display: flex;
  align-items: center;
}

.recent-activity {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1f2d3d;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ebeef5;
}

.activity-list {
  list-style: none;
}

.activity-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: #409eff;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.activity-time {
  font-size: 0.85rem;
  color: #909399;
}

.footer {
  text-align: center;
  padding: 20px;
  color: #a8abb2;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
  background: white;
}

@media (max-width: 768px) {
  .container {
    height: auto;
    max-height: 95vh;
  }

  .sidebar {
    position: absolute;
    z-index: 100;
    height: calc(100% - 60px);
  }

  .sidebar.collapsed {
    width: 0;
  }

  .content-area {
    padding: 15px;
  }
}
</style>
